<template>
<!--  <block class="file_icon">-->
  <block>
    <u-image :style="customStyle" :height="height" :width="width" :src="iconPath"></u-image>
  </block>
</template>

<script>
export default {
  name: "j-file-icon",
  props: {
    type:{//文件后缀名带点
      type: String
    },
    customStyle:{
      type: Object,
      default:()=>({})
    },
    height:{
      type: String,
      default: '80'
    },
    width:{
      type: String,
      default: '80'
    }
  },
  computed:{
    iconPath(){
      if(this.$j.fileTypes.Word.includes(this.type)){
        return '/static/icons/word.svg'
      }else if(this.$j.fileTypes.Excel.includes(this.type)){
        return '/static/icons/xsl.svg'
      }else if(this.$j.fileTypes.OpenOffice.includes(this.type)){
        return '/static/icons/odt.svg'
      }else if(this.$j.fileTypes.Visio.includes(this.type)){
        return '/static/icons/visio.svg'
      }else if(this.$j.fileTypes.Powerpoint.includes(this.type)){
        return '/static/icons/ppt.svg'
      }else {
        return '/static/icons/bill.svg'
      }
    }
  },
  methods: {},
}
</script>

<style lang="scss" scoped>
/*.file_icon{
  position: relative;
  width: 80rpx;
  height: 80rpx;

  >image{
    position: absolute;
    width: 100%;
    height: 100%;
  }
}*/
</style>
